package display;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class InventoryThread extends Thread {

	private File f;
	private InventoryData inv;
	private String isbnf, isbnm, author, title, qty, loc;
	
	public InventoryThread(InventoryData invd, File file) {
		f = file;
		inv = invd;
	}
	
	public void run() {
		try {
			Scanner sc = new Scanner(new FileInputStream(f)).useDelimiter("\t|\n");
			
			while (sc.hasNext()) {
				
				readLine(sc);
				
				
			}
			
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public void readLine(Scanner sc) {
		isbnf = sc.next();
		isbnm = sc.next();
		author = sc.next();
		title = sc.next();
		qty = sc.next();
		loc = sc.next();
		
		sc.next(); // nLoc
		sc.next(); // .
		sc.next(); // Dups
		sc.next(); // Summer Dept
		sc.next(); // Summer Crs
		sc.next(); // Summer Dept
		sc.next(); // Summer Crs
		sc.next(); // Fall Dept
		sc.next(); // Fall Crs
		sc.next(); // Fall Dept
		sc.next(); // Fall Crs
		sc.next(); // isbn
		
	}
}
